/**
 SiversPositivity.cxx
 
 \file
 Implementation of class SiversPositivity.
 
 \author Thomas Burton 
 \date 3/12/12
 \copyright 2012 BNL. All rights reserved.
 */

#include "tppmc/sivers/Positivity.h"

#ifdef USING_LHAPDF
#include <LHAPDF/LHAPDF.h>
#else
#include "tppmc/Enumerations.h"
#endif

#include "tppmc/Grv98Pdf.h"
#include "tppmc/Particle.h"

namespace tppmc {

   namespace sivers {

      Positivity::Positivity()
      : mUnpolarised(new Grv98Pdf(Grv98Pdf::LO)) {
      }

      Positivity::Positivity(boost::shared_ptr<PartonDistribution> unpol)
      : mUnpolarised(unpol) {
      }

      Positivity::~Positivity() {
      }

      void Positivity::Evaluate(const Parton& parton, double scale,
                                PartonContent& values) const {
         mUnpolarised->Evaluate(parton, scale, values);
         values[LHAPDF::DOWN] = -values[LHAPDF::DOWN];
         int sea[5] = {
            LHAPDF::UBAR, LHAPDF::DBAR, LHAPDF::SBAR, LHAPDF::STRANGE,
            LHAPDF::GLUON
         };
         for(int i(0); i < 5; ++i) {
            values[sea[i]] = 0.;
         } // for
      }

      bool Positivity::Supports(const Parton& parton) const {
         return mUnpolarised->Supports(parton);
      }

      std::string Positivity::Name() const {
         return "Positivity bound from " + mUnpolarised->Name();
      }

      Int_t	Positivity::Write(const char*, Int_t, Int_t) {
         return 0;
      }

      Int_t	Positivity::Write(const char*, Int_t, Int_t) const {
         return 0;
      }
   } // namespace sivers
} // namespace tppmc
